
#ifndef PROMPTLISTFILTER_H
#define PROMPTLISTFILTER_H

#include <BAction>
#include <BTextEdit>
#include <BListWidget>
#include <BEventFilter>

#include "SourceFormat.h"

class PromptListFilter : public BEventFilter
{
	BOBJECT(PromptListFilter)
public:
	PromptListFilter();
	~PromptListFilter();

protected:
	void prompt(const SourceFormat::Item* item, int index);
	void finish();
	bool checkCueItem(const BListItem* item);

protected:
	void slotTextEdited(BObject* object, const BValue& value);
	void slotListItemClicked(BObject* object, const BValue& value);
	void slotListAreaResized(BObject* object, const BValue& value);
	void slotSourceEditFreshed(BObject* object, const BValue& value);

protected:
	virtual void attached(BWidget* widget);
	virtual void detached(BWidget* widget);


	virtual void focusEvent(const BEvent& event);
	virtual void inputEvent(const BEvent& event);

	virtual void keyPressEvent(const BKeyEvent& keyEvent);

private:
	BTextEdit*				_textEdit;
	BHolder<BListWidget>	_listWidget;

	BString				_head;
	int					_index;
	BListItemHolder		_cueItem;
};

#endif
